package com.bjSoft.regressionTestTool.config;

import java.util.Iterator;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;

import com.bjSoft.regressionTestTool.Activator;
import com.bjSoft.regressionTestTool.config.ui.ConfigDialog;
import com.bjSoft.regressionTestTool.core.codeCoverage.action.AuxiliarCoverageAction;

public class ConfigurationAction implements IObjectActionDelegate{
	private ISelection selection;
	public ConfigurationAction() {
		// TODO Auto-generated constructor stub
	}

	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
		// TODO Auto-generated method stub
		
	}

	public void run(IAction action) {
		if (selection instanceof IStructuredSelection) {
			IWorkbenchWindow window = 
				Activator.getDefault().getWorkbench().getActiveWorkbenchWindow();
			ConfigDialog confDialog = new ConfigDialog(window.getShell());
			confDialog.open();			
		}		
		
	}

	public void selectionChanged(IAction action, ISelection selection) {
		this.selection = selection;	
		
	}

}
